/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package webOffline;

/**
 *
 * @author Do Viet Trung
 */

public enum PatternType {
    ITEM,
    ALL,
    LIMIT;
    
    public static PatternType indentifyTpe (String pattern) {
        if(pattern.contains("*.")) {//default/*.jpg
            return PatternType.ITEM;
        }

        //default/* - default/ - default/index.html
        if(pattern.endsWith("/*") || pattern.endsWith("/")) {
            return PatternType.ALL;
        }

        if(pattern.endsWith(Pattern.LIMIT_PATTERN)) {
            return  LIMIT;
        }

        return PatternType.ALL;
    }
}
